// 图片的类型
export type Base64 = string;
export type BlobUrl = string;
export type ImgUrl = string;
export type ImgSrc = Base64 | BlobUrl | ImgUrl;

export interface ImageBaseModel {
  src: ImgSrc;
  width: number;
  height: number;
  x?: number;
  y?: number;
}

// 图片的操作属性
export type ImagePosModel = Pick<ImageBaseModel, 'src' | 'x' | 'y'>;
export type ImageSizeModel = Pick<ImageBaseModel, 'src' | 'width' | 'height'>;

export function createImagePosModel(src: ImgSrc, x: number = 0, y: number = 0): ImagePosModel {
  return {
    src,
    x,
    y,
  };
}
